home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / GTVWSTNG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  816 b   |  31 lines

  1. /* getviewsettings */
  2. #include <stdio.h>
  3. #include <graphics.h>
  4.  
  5. main()
  6. {
  7.     int graphdriver = DETECT,graphmode;
  8.     struct viewporttype cur_view;
  9.     char buffer[80];
  10.  
  11. /*  Initialize the graphics system */
  12.     initgraph(&graphdriver,&graphmode,"c:\\turboc");
  13.     outtextxy(10,20,"Demonstrating getviewsettings");
  14. /* Get current viewport and print it out */
  15.     getviewsettings(&cur_view);
  16.     outtextxy(10,60,"Current viewport settings");
  17.     sprintf(buffer,"Left, top    = %d, %d",
  18.         cur_view.left,cur_view.top);
  19.     outtextxy(10,70,buffer);
  20.     sprintf(buffer,"Right, bottom = %d, %d",
  21.         cur_view.right,cur_view.bottom);
  22.     outtextxy(10,80,buffer);
  23.     if(!cur_view.clip)
  24.         outtextxy(10,90,"Clipping OFF");
  25.     else
  26.         outtextxy(10,90,"Clipping ON");
  27.     outtextxy(10,270,"Hit any key to exit:");
  28.     getch();
  29.     closegraph();
  30. }
  31.